import { axios } from '@/utils/request'

/**
 * 查询开课
 *
 * @author kongxm
 * @date 2022-07-07 21:52:25
 */
export function coursePublishPage(parameter) {
  return axios({
    url: '/coursePublish/page',
    method: 'get',
    params: parameter
  })
}

/**
 * 查询开课-with-name
 *
 * @author kongxm
 * @date 2022-07-07 21:52:25
 */
export function coursePublishPageWithName(parameter) {
  return axios({
    url: '/coursePublish/pageWithName',
    method: 'get',
    params: parameter
  })
}

/**
 * 开课列表
 *
 * @author kongxm
 * @date 2022-07-07 21:52:25
 */
export function coursePublishList(parameter) {
  return axios({
    url: '/coursePublish/list',
    method: 'get',
    params: parameter
  })
}

/**
 * 添加开课
 *
 * @author kongxm
 * @date 2022-07-07 21:52:25
 */
export function coursePublishAdd(parameter) {
  return axios({
    url: '/coursePublish/add',
    method: 'post',
    data: parameter
  })
}

/**
 * 编辑开课
 *
 * @author kongxm
 * @date 2022-07-07 21:52:25
 */
export function coursePublishEdit(parameter) {
  return axios({
    url: '/coursePublish/edit',
    method: 'post',
    data: parameter
  })
}

/**
 * 删除开课
 *
 * @author kongxm
 * @date 2022-07-07 21:52:25
 */
export function coursePublishDelete(parameter) {
  return axios({
    url: '/coursePublish/delete',
    method: 'post',
    data: parameter
  })
}

/**
 * 导出开课
 *
 * @author kongxm
 * @date 2022-07-07 21:52:25
 */
export function coursePublishExport(parameter) {
  return axios({
    url: '/coursePublish/export',
    method: 'get',
    params: parameter,
    responseType: 'blob'
  })
}

/**
 * 发布
 *
 * @author kongxm
 * @date 2022-07-07 21:52:25
 */
export function coursePublishPublish(id) {
  return axios({
    url: `/coursePublish/publish/${id}`,
    method: 'post'
  })
}

/**
 * 撤回
 *
 * @author kongxm
 * @date 2022-07-07 21:52:25
 */
export function coursePublishRollback(id) {
  return axios({
    url: `/coursePublish/rollback/${id}`,
    method: 'post'
  })
}

/**
 * copy
 *
 * @author kongxm
 * @date 2022-07-07 21:52:25
 */
export function coursePublishCopy(id) {
  return axios({
    url: `/coursePublish/copy/${id}`,
    method: 'post'
  })
}

/**
 * 开课详情
 *
 * @author kongxm
 * @date 2022-07-07 21:52:25
 */
export function coursePublishDetail(parameter) {
  return axios({
    url: '/coursePublish/detail',
    method: 'get',
    params: parameter
  })
}

/**
 * 导出学生采集模板
 *
 * @author kongxm
 * @date 2022-07-07 21:52:25
 */
export function exportStudentCollectionTemplate() {
  return axios({
    url: '/coursePublish/exportStudentCollectionTemplate',
    method: 'get',
    responseType: 'blob'
  })
}

/**
 * 上传学生列表
 *
 * @author kongxm
 * @date 2020/6/30 00:20
 */
export function uploadStudentList(params) {
  return axios({
    url: '/coursePublish/uploadStudentList',
    method: 'post',
    data: params
  })
}


/**
 * 选课确认
 */
export function coursePublishConfirm(id) {
  return axios({
    url: `/coursePublish/toConfirm/${id}`,
    method: 'post'
  })
}


/**
 * 取消选课确认
 */
export function coursePublishCancelConfirm(id) {
  return axios({
    url: `/coursePublish/cancelConfirm/${id}`,
    method: 'post'
  })
}